<?php

namespace App\Jobs;

use App\Models\PandaFans;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SavePandaFans implements ShouldQueue
{
  use InteractsWithQueue, Queueable, SerializesModels;
  protected $fans;
  /**
   * Create a new job instance.
   *
   * @return void
   */
  public function __construct($fans)
  {
    $this->fans = $fans;
  }

  /**
   * Execute the job.
   *
   * @return void
   */
  public function handle()
  {
    PandaFans::insertOnDuplicateKey($this->fans);
  }
}
